<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>new (Spec::Mocks::ArgumentExpectation)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/mocks/argument_expectation.rb, line 120</span>
      <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
        <span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span>
        <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:any_args</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">args</span>
          <span class="ruby-ivar">@expected_params</span> = <span class="ruby-keyword kw">nil</span>
          <span class="ruby-identifier">warn_deprecated</span>(<span class="ruby-identifier">:any_args</span>.<span class="ruby-identifier">inspect</span>, <span class="ruby-value str">&quot;any_args()&quot;</span>)
        <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">AnyArgsConstraint</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-ivar">@expected_params</span> = <span class="ruby-keyword kw">nil</span>
        <span class="ruby-keyword kw">elsif</span> [<span class="ruby-identifier">:no_args</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">args</span>
          <span class="ruby-ivar">@expected_params</span> = []
          <span class="ruby-identifier">warn_deprecated</span>(<span class="ruby-identifier">:no_args</span>.<span class="ruby-identifier">inspect</span>, <span class="ruby-value str">&quot;no_args()&quot;</span>)
        <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NoArgsConstraint</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-ivar">@expected_params</span> = []
        <span class="ruby-keyword kw">else</span> <span class="ruby-ivar">@expected_params</span> = <span class="ruby-identifier">process_arg_constraints</span>(<span class="ruby-identifier">args</span>)
        <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span></pre>
</body>
</html>